package application.controller;

import application.adapter.TreeAdapter;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;

public class RootTreeItem {

    @FXML
    private Label label;

    @FXML
    private Button button;

    @FXML
    private void initialize(){
        button.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                System.out.println("触发button事件！");
            }
        });
    }

    public void init(TreeAdapter.TreeEntry entry) {
        label.setText(((TestTree.Entry) entry).getName());
    }
}
